﻿//▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
// 프로그램 명		: frmCodeManagement.cs
// 프로그램 기능		: BOM Code (Cad / Part / Purchasing Part) 관리
// 클래스 기능		: Code를 추가/삭제/수정 관리하는 MDI 내부 폼의 BOM 단위 클래스
//▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
// 개발자			: 김승현, 조범준
// 개발일			: 2014-06-24
//▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
// F/W 버전		    : Dot NET Compack Framework 4.0 Service Pack 1 Patch
// 라이센스			: Copyright ⓒ 2014-2014 All rights reserved.
//▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
// 명명규칙			: 클래스(class) 명				- "c" + 클래스명
//					  전역(private) 상수			- "MC_" + 상수명
//					  공용(public)  상수			- "PC_" + 상수명
//					  전역(private) 변수/객체/핸들/구조체/컬렉션/델리게이트
//													- "mv_" + 타입/obj_/hwnd_/stru_/coll_/del_ + 명
//					  공용(public)  변수/객체/핸들/구조체/컬렉션/델리게이트/이벤트
//													- "pv_" + 타입/obj_/hwnd_/stru_/coll_/del_/evnt_ + 명
//					  공용(public)  속성(Property)	- "pp_" + 타입 + 속성명
//					  전역(private) 함수/API		- "mf_" + 함수명/API 함수명
//					  공용(public)  함수/API		- "pf_" + 함수명/API 함수명
//▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
// 개발자는 개발/수정시 위의 내용을 반드시 작성하며 내용이 일치하지 않을때에는 모든 사항을 개발자가 책임 진다.
//▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
//▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬

//▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
namespace TimsXBX
{
	///▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
	/// <summary>frmCodeManagement 클래스</summary>
	///▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
	public partial class frmCodeManagement : Form
	{
		//▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
		#region [생성자/소멸자]
		///-------------------------------------------------------------------------------------------------------------------------
		/// <summary>생성자</summary>
		///-------------------------------------------------------------------------------------------------------------------------
		public frmCodeManagement(frmMain fMain, string sJobName)
		{
			InitializeComponent();

			this.mv_frmMain = fMain;
			this.mv_sJobName = sJobName;
		}
		public frmCodeManagement(frmMain fMain)
		{
			InitializeComponent();

			this.mv_frmMain = fMain;
		}
		public frmCodeManagement()
		{
			InitializeComponent();
			mf_Init(this);
		}
		///-------------------------------------------------------------------------------------------------------------------------
		/// <summary>소멸자</summary>
		///-------------------------------------------------------------------------------------------------------------------------
		~frmCodeManagement()
		{
			mf_UnInit(this);
		}
		#endregion

		//▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
		#region [전역(private) 상수 - 클래스 내부만 노출]
		//▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
		//명명규칙 - 상수명 첫 문자는 "MC_" 로 시작
		//         - 전체를 영문 대문자로 하고 상수명이 긴 경우 '_'로 구분해서 명명
		//▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
		///-------------------------------------------------------------------------------------------------------------------------
		///<summary>전역(private) 상수 선언 예</summary>
		///-------------------------------------------------------------------------------------------------------------------------
		private const string MC_HELLO = "Hello...";
		#endregion

		//▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
		#region [공용(public) 상수 - 클래스 외부로 노출]
		//▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
		//명명규칙 - 상수명 첫 문자는 "PC_" 로 시작
		//         - 전체를 영문 대문자로 하고 상수명이 긴 경우 '_'로 구분해서 명명
		//▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
		///-------------------------------------------------------------------------------------------------------------------------
		///<summary>공용(public) 상수 선언 예</summary>
		///-------------------------------------------------------------------------------------------------------------------------
		public const string PC_HELLO = "Hello...";
		#endregion

		//▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
		#region [전역(private) 변수/객체/핸들/구조체/컬렉션/델리게이트 - 클래스 내부만 노출]
		//▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
		//명명규칙 - 첫 문자를 "mv_타입"/"mv_obj"/"mv_hwnd"/"mv_struc"/"mv_coll"/"mv_del" 로 시작
		//         - 영문 대소문자로 시작하고 변수명이 긴 경우 대소문자 구분해서 명명('_' 사용가능!)
		//▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
		///-------------------------------------------------------------------------------------------------------------------------
		/// <summary>전역(private) 변수 선언 예</summary>
		///-------------------------------------------------------------------------------------------------------------------------
		private string mv_sHello = null;
		//---------------------------------------------------------------------------------------------------
		//메인 폼 객체 핸들
		//---------------------------------------------------------------------------------------------------
		private frmMain mv_frmMain = null;										//메인 폼 인스턴스 핸들
		private ComCls.cFunction mv_oFunc = null;								//공용함수 인스턴스 핸들

		private string mv_sJobName = null;														//작업구분(Part/Cad/Purchasing Part)
		private int mv_nJobCode = 0;															//작업별 DB 저장 코드
		private string[] mv_saTreeSelectCode = null;											//Tree Code 선택시 Parsing
		private string[] mv_saTreeProperty = null;												//Tree Code 값 변경시 부모노드 Parsing
		private string[] mv_saTreeSepa = new string[] { ComCls.cConst.PC_TREE_SEPARATOR_TAG };	//Tree Tag 구분자
		//---------------------------------------------------------------------------------------------------
		#endregion

		//▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
		#region [공용(public) 변수/객체/핸들/구조체/컬렉션/델리게이트/이벤트 - 클래스 외부로 노출]
		//▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
		//명명규칙 - 첫 문자를 "pv_타입"/"pv_obj"/"pv_hwnd"/"pv_struc"/"pv_coll"/"pv_del"/"pv_event" 로 시작
		//         - 영문 대소문자로 시작하고 변수명이 긴 경우 대소문자 구분해서 명명('_' 사용가능!)
		//▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
		///-------------------------------------------------------------------------------------------------------------------------
		/// <summary>공용(public) 변수 선언 예</summary>
		///-------------------------------------------------------------------------------------------------------------------------
		public string pv_sHello = null;
		#endregion

		//▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
		#region [공용(public) 속성(Property:읽기 쓰기 선택적 가능) - 클래스 외부로 노출]
		//▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
		//명명규칙 - 첫 문자를 "pp_타입" 로 시작
		//         - 영문 대소문자로 시작하고 속성명이 긴 경우 대소문자 구분해서 명명('_' 사용가능!)
		//▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
		///-------------------------------------------------------------------------------------------------------------------------
		/// <summary>공용(public) 속성(Property) 선언 예</summary>
		///-------------------------------------------------------------------------------------------------------------------------
		public string pp_bHello
		{
			get { return mv_sHello; }
			set { mv_sHello = value; }
		}
		#endregion

		//▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
		#region [전역(private) 함수/API - 클래스 내부만 노출]
		//▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
		//명명규칙 - 첫 문자를 "mf_" + 함수명 또는 API 함수명 으로 시작
		//         - 영문 대소문자로 시작하고 함수명이 긴 경우 대소문자 구분해서 명명('_' 사용가능!)
		//▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
		///-------------------------------------------------------------------------------------------------------------------------
		/// <summary>전역(private) 함수 선언 예</summary>
		/// <param name="sStr">전역(private) 함수 인자 선언 예</param>
		/// <returns>string</returns>
		///-------------------------------------------------------------------------------------------------------------------------
		private string mf_Hello(string sStr)
		{
			try
			{
				sStr = "Hello...";
			}
			catch (Exception ex)
			{
				throw ex;
			}

			return sStr;
		}

		///-------------------------------------------------------------------------------------------------------------------------
		/// <summary>클래스 초기화</summary>
		/// <param name="objClass">클래스 객체 인스턴스</param>
		/// <returns>void</returns>
		///-------------------------------------------------------------------------------------------------------------------------
		private void mf_Init(frmCodeManagement objClass)
		{
			try
			{
				//클래스 초기화
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		///-------------------------------------------------------------------------------------------------------------------------
		/// <summary>클래스 마무리</summary>
		/// <param name="objClass">클래스 객체 인스턴스</param>
		/// <returns>void</returns>
		///-------------------------------------------------------------------------------------------------------------------------
		private void mf_UnInit(frmCodeManagement objClass)
		{
			try
			{
				//클래스 마무리
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}

		///-------------------------------------------------------------------------------------------------------------------------
		/// <summary>Edit 버튼 눌렀을시 수정가능하도록</summary>
		/// <param name="bEditableOK">수정 가능여부</param>
		/// <returns>void</returns>
		///-------------------------------------------------------------------------------------------------------------------------
		public void mf_EditMode(bool bEditableOK)
		{
			//---------------------------------------------------------------------------------------------------
			//수정 가능 시
			//---------------------------------------------------------------------------------------------------
			if (bEditableOK == true)
			{
				this.treeCode.Enabled = false;		//TreeView 제어

				this.txtCodeValue.ReadOnly = false;		//Code Value 작성창 제어
				this.txtCodeName.ReadOnly = false;		//Code Name  작성창 제어

				this.btnRefresh.Enabled = false;		//Refresh 버튼 제어
				this.btnAdd.Enabled = false;			//Add 버튼 제어
				this.btnEdit.Enabled = false;			//Edit 버튼 제어
				this.btnDelete.Enabled = false;			//Delete 버튼 제어
				this.btnSave.Enabled = true;			//Save 버튼 제어
				this.btnCancel.Enabled = true;			//Cancel 버튼 제어

			}
			//---------------------------------------------------------------------------------------------------
			//수정 불가능 시
			//---------------------------------------------------------------------------------------------------
			else
			{
				this.treeCode.Enabled = true;

				this.txtCodeValue.ReadOnly = true;
				this.txtCodeName.ReadOnly = true;

				this.btnRefresh.Enabled = true;
				this.btnAdd.Enabled = true;
				this.btnEdit.Enabled = true;
				this.btnDelete.Enabled = true;
				this.btnSave.Enabled = false;
				this.btnCancel.Enabled = false;
			}
		}

		///-------------------------------------------------------------------------------------------------------------------------
		/// <summary>Code 목록을 TreeView에 출력</summary>
		/// <returns>void</returns>
		///-------------------------------------------------------------------------------------------------------------------------
		public void mf_ReadCodeTreeView()
		{
			//---------------------------------------------------------------------------------------------------
			//Web Sql 정보 관련
			//---------------------------------------------------------------------------------------------------
			string sWebSql = null;
			string sWebArg = null;
			//---------------------------------------------------------------------------------------------------
			//Web Sql 실행 관련
			//---------------------------------------------------------------------------------------------------
			string sDataSet = null;
			DataSet oDataSet = null;
			int nRowCount = 0;
			int nColCount = 0;
			string sErrorMsg = null;
			//---------------------------------------------------------------------------------------------------
			//Web Sql 결과 관련
			//---------------------------------------------------------------------------------------------------
			string[] saDataSetRows = null;
			string[] saDataSetCols = null;
			string[] saColSepa = new string[] { ComCls.cConst.PC_SEPARATOR_COL };
			string[] saRowSepa = new string[] { ComCls.cConst.PC_SEPARATOR_ROW };

			try
			{
				//---------------------------------------------------------------------------------------------------
				//Web Sql 경로 만들기
				//---------------------------------------------------------------------------------------------------
				sWebSql = ComCls.cConst.PC_WEBSQL_WEBPARSE_URL;
				sWebArg = string.Format("?{0}={1}&{2}={3}&{4}={5}&{6}={7}&{8}={9}",
											ComCls.cConst.PC_WEBSQL_MODE, ComCls.cConst.PC_WEBSQL_MODE_R,
											ComCls.cConst.PC_WEBSQL_TYPE, ComCls.cConst.PC_WEBSQL_TYPE_PARSE,
											ComCls.cConst.PC_WEBSQL_STYLE, ComCls.cConst.PC_WEBSQL_STYLE_SP,
											ComCls.cConst.PC_WEBSQL_CMD_SP, "SP_CODE_MANAGEMENT_R",
											"iNAME", this.mv_sJobName);
				sWebSql += sWebArg;
				//---------------------------------------------------------------------------------------------------
				//Web Sql 실행
				//---------------------------------------------------------------------------------------------------
				if (this.mv_oFunc.pf_WpExecSql(ComCls.cConst.PE_WEBSQL_TYPE.PARSE, sWebSql, ref sDataSet, ref oDataSet, ref nRowCount, ref nColCount, ref sErrorMsg) == true)
				{
					if (nRowCount > 0)
					{
						saDataSetRows = sDataSet.Split(saRowSepa, StringSplitOptions.None);
						saDataSetCols = saDataSetRows[0].Split(saColSepa, StringSplitOptions.None);
						this.mv_nJobCode = Convert.ToInt32(saDataSetCols[2]);

						this.mv_oFunc.pf_WpOutputDataSetToTreeView(ComCls.cConst.PE_WEBSQL_TYPE.PARSE, this.treeCode, null, "-1", sDataSet, oDataSet, 3, true, true);
					}
					else
					{
						ComCls.cException.MessageErrorBoxShow(this, ComCls.cConst.PC_ERROR_NODATA, ComCls.cConst.PC_MSG_APPBOM_SELECT_TITLE);
					}
				}
				else
				{
					if (sErrorMsg != null)
					{
						ComCls.cException.ExceptionMessage(this, sErrorMsg, "mf_ReadCodeTreeView()");
					}
				}
				//---------------------------------------------------------------------------------------------------
			}
			catch (Exception ex)
			{
				throw ex;
			}
			finally
			{
				//---------------------------------------------------------------------------------------------------
				//Debug Agent 인스턴스 있는 경우
				//---------------------------------------------------------------------------------------------------
				if (this.mv_frmMain.pv_frmDebugAgent != null)
				{
					this.mv_frmMain.pv_frmDebugAgent.pf_OutputDebugInfo(ComCls.cConst.PE_WEBSQL_TYPE.PARSE, sWebSql, sDataSet, oDataSet);
				}
				//---------------------------------------------------------------------------------------------------
			}

		}
		///-------------------------------------------------------------------------------------------------------------------------
		/// <summary>Code 목록을 저장/수정/삭제</summary>
		/// <param name="sSPName">스토어드명</param>
		/// <param name="sJobMode">작업모드</param>
		/// <param name="nObjectId">오브젝트아이디</param>
		/// <param name="nJobCode">작업분야(Part/Code/Purchasing Part)</param>
		/// <param name="sCode">코드 값</param>
		/// <param name="sPattern">코드 패턴</param>
		/// <param name="sKorName">코드명</param>
		/// <returns>bool</returns>
		///-------------------------------------------------------------------------------------------------------------------------
		public bool mf_CUDCodeData(string sSPName, string sJobMode, int nObjectId, int nJobCode, string sCode, string sPattern, string sKorName)
		{
			//---------------------------------------------------------------------------------------------------
			//Web Sql 정보 관련
			//---------------------------------------------------------------------------------------------------
			string sWebSql = null;
			string sWebArg = null;
			//---------------------------------------------------------------------------------------------------
			//Web Sql 실행 관련
			//---------------------------------------------------------------------------------------------------
			string sDataSet = null;
			DataSet oDataSet = null;
			int nRowCount = 0;
			int nColCount = 0;
			string sErrorMsg = null;
			bool nResultOK = false;

			int nParentObjectId = -1;

			//---------------------------------------------------------------------------------------------------
			//부모노드가 있는 경우 부모 ObjectID 일기
			// - 부모노드 없는 경우 -1 (최상위 노드)
			//---------------------------------------------------------------------------------------------------
			if (this.treeCode.SelectedNode.Parent != null)
				nParentObjectId = int.Parse(this.treeCode.SelectedNode.Parent.Name);

			try
			{
				if (this.treeCode.SelectedNode != null)
				{
					//---------------------------------------------------------------------------------------------------
					//Web Sql 경로 만들기
					//---------------------------------------------------------------------------------------------------
					sWebSql = ComCls.cConst.PC_WEBSQL_WEBPARSE_URL;
					sWebArg = string.Format("?{0}={1}&{2}={3}&{4}={5}&{6}={7}&{8}={9}&{10}={11}&{12}={13}&{14}={15}&{16}={17}&{18}={19}&{20}={21}",
											ComCls.cConst.PC_WEBSQL_MODE, ComCls.cConst.PC_WEBSQL_MODE_CUD,
											ComCls.cConst.PC_WEBSQL_TYPE, ComCls.cConst.PC_WEBSQL_TYPE_PARSE,
											ComCls.cConst.PC_WEBSQL_STYLE, ComCls.cConst.PC_WEBSQL_STYLE_SP,
											ComCls.cConst.PC_WEBSQL_CMD_SP, sSPName,
											"iJOBMODE", sJobMode,
											"iOBJECTID", nObjectId,
											"iPAR_OBJECTID", nParentObjectId,
											"iGRP_OBJECTID", nJobCode,
											"iCODE", sCode,
											"iPATTERN", sPattern,
											"iKOR_NAME", sKorName);
					sWebSql += sWebArg;
					//---------------------------------------------------------------------------------------------------
					//Web Sql 실행
					//---------------------------------------------------------------------------------------------------
					if (this.mv_oFunc.pf_WpExecSql(ComCls.cConst.PE_WEBSQL_TYPE.PARSE, sWebSql, ref sDataSet, ref oDataSet, ref nRowCount, ref nColCount, ref sErrorMsg) == true)
					{
						nResultOK = true;
						//저장 / 수정
						if (sJobMode.Contains("CREATE") || sJobMode.Contains("UPDATE"))
							ComCls.cException.MessageBoxShow(this, ComCls.cConst.PC_MSG_APPBOM_UPDATE, ComCls.cConst.PC_MSG_APPBOM_UPDATE_TITLE);
						//삭제
						if (sJobMode.Contains("DELETE"))
							ComCls.cException.MessageBoxShow(this, ComCls.cConst.PC_MSG_APPBOM_DELETE, ComCls.cConst.PC_MSG_APPBOM_DELETE_TITLE);
					}
					else
					{
						if (sErrorMsg != null)
						{
							ComCls.cException.ExceptionMessage(this, sErrorMsg, "mf_CUDCodeData()");
						}
					}
				}
				else
				{
					ComCls.cException.MessageErrorBoxShow(this, ComCls.cConst.PC_MSG_NOSELECT_TREENODE, ComCls.cConst.PC_MSG_NOSELECT_TREENODE_TITLE);
				}
			}
			catch (Exception ex)
			{
				throw ex;
			}
			//---------------------------------------------------------------------------------------------------
			//결과 반환
			//---------------------------------------------------------------------------------------------------
			return nResultOK;
		}
		#endregion

		//▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
		#region [공용(public) 함수(Method)/API - 클래스 외부로 노출]
		//▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
		//명명규칙 - 첫 문자를 "pf_" + 함수명 또는 API 함수명 으로 시작
		//         - 영문 대소문자로 시작하고 함수명이 긴 경우 대소문자 구분해서 명명('_' 사용가능!)
		//▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
		///-------------------------------------------------------------------------------------------------------------------------
		/// <summary>공용(public) 함수(Method) 선언 예</summary>
		/// <param name="sStr">공용(public) 함수(Method) 인자 선언 예</param>
		/// <returns>string</returns>
		///-------------------------------------------------------------------------------------------------------------------------
		public string pf_Hello(string sStr)
		{
			try
			{
				sStr = "Hello...";
			}
			catch (Exception ex)
			{
				throw ex;
			}

			return sStr;
		}
		#endregion

		//▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
		#region [전역(private) 시스템 이벤트함수 - 클래스 내부만 노출]
		//▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
		//명명규칙 - 없음!
		//▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
		///-------------------------------------------------------------------------------------------------------------------------
		/// <summary>폼 로드 될 때 발생</summary>
		///-------------------------------------------------------------------------------------------------------------------------
		private void frmCodeManagement_Load(object sender, EventArgs e)
		{
			try
			{
				//---------------------------------------------------------------------------------------------------
				//공용함수 인스턴스 생성
				//---------------------------------------------------------------------------------------------------
				this.mv_oFunc = new ComCls.cFunction(this);
				//---------------------------------------------------------------------------------------------------
				//폼 타이틀 만들기
				//---------------------------------------------------------------------------------------------------
				this.Text = this.mv_sJobName + " " + this.Text;
				//---------------------------------------------------------------------------------------------------
				//수정여부 함수 호출
				//---------------------------------------------------------------------------------------------------
				this.mf_EditMode(false);
				//---------------------------------------------------------------------------------------------------
				//TreeView 초기화
				//---------------------------------------------------------------------------------------------------
				this.mv_oFunc.pf_TreeInit(this.treeCode, null, this.mv_frmMain.imageTreeNode, false, System.Windows.Forms.MouseButtons.Right);
				//---------------------------------------------------------------------------------------------------
				//Code 목록 TreeView에 새로 출력
				//---------------------------------------------------------------------------------------------------
				this.mf_ReadCodeTreeView();
				//---------------------------------------------------------------------------------------------------
			}
			catch (Exception ex)
			{
				ComCls.cException.ExceptionMessageBox(ex, this);
			}
		}
		///-------------------------------------------------------------------------------------------------------------------------
		/// <summary>폼 언로드 될 때 발생</summary>
		///-------------------------------------------------------------------------------------------------------------------------
		private void frmCodeManagement_FormClosing(object sender, FormClosingEventArgs e)
		{
			try
			{
				this.mv_oFunc.pf_CheckBomExitMsg(this.mv_frmMain.pv_bChildFormExitMsgDispOK, this.Text, ref e);
			}
			catch (Exception ex)
			{
				ComCls.cException.ExceptionMessageBox(ex, this);
			}
		}
		///-------------------------------------------------------------------------------------------------------------------------
		/// <summary>폼 언로드 되고 발생</summary>
		///-------------------------------------------------------------------------------------------------------------------------
		private void frmCodeManagement_FormClosed(object sender, FormClosedEventArgs e)
		{
			try
			{
				//폼 닫기가 확정된 경우에만 해쉬에서 제거
				this.mv_oFunc.pf_AppBomRun(ComCls.cConst.PE_ARGTYPE_APP_STATUS.EXIT, this.Text, null, null);
			}
			catch (Exception ex)
			{
				ComCls.cException.ExceptionMessageBox(ex, this);
			}
		}
		///-------------------------------------------------------------------------------------------------------------------------
		/// <summary>Add 버튼 클릭</summary>
		///-------------------------------------------------------------------------------------------------------------------------
		private void btnAdd_Click(object sender, EventArgs e)
		{
			TreeNode tnAddNewNode = new TreeNode { Text = "*New Code", Name = "*" };

			try
			{
				if (this.treeCode.SelectedNode != null)
				{
					if (ComCls.cException.MessageConfirmBoxShow(this, string.Format("[{0}]{1}", this.treeCode.SelectedNode.Text, ComCls.cConst.PC_MSG_APPBOM_UPDATE_TREE_CONFIRM),
																ComCls.cConst.PC_MSG_APPBOM_UPDATE_TITLE) == System.Windows.Forms.DialogResult.Yes)
					{
						//---------------------------------------------------------------------------------------------------
						//입력할 TextBox 초기화
						//---------------------------------------------------------------------------------------------------
						this.txtCodeValue.Text = null;
						this.txtCodeName.Text = null;
						this.txtPattern.Text = null;
						//---------------------------------------------------------------------------------------------------
						//추가될 노드 임시 생성
						//---------------------------------------------------------------------------------------------------
						this.treeCode.SelectedNode.Nodes.Add(tnAddNewNode);
						this.treeCode.SelectedNode = tnAddNewNode;
						//---------------------------------------------------------------------------------------------------
						//수정여부 함수 호출 - 가능
						//---------------------------------------------------------------------------------------------------
						this.mf_EditMode(true);
					}
				}
				else
				{
					ComCls.cException.MessageErrorBoxShow(this, ComCls.cConst.PC_MSG_NOSELECT_TREENODE, ComCls.cConst.PC_MSG_NOSELECT_TREENODE_TITLE);
				}
			}
			catch (Exception ex)
			{
				ComCls.cException.ExceptionMessageBox(ex, this);
			}
		}
		///-------------------------------------------------------------------------------------------------------------------------
		/// <summary>Edit 버튼 클릭</summary>
		///-------------------------------------------------------------------------------------------------------------------------
		private void btnEdit_Click(object sender, EventArgs e)
		{
			try
			{
				//---------------------------------------------------------------------------------------------------
				//수정여부 함수 호출 - 가능
				//---------------------------------------------------------------------------------------------------
				this.mf_EditMode(true);
			}
			catch (Exception ex)
			{
				ComCls.cException.ExceptionMessageBox(ex, this);
			}
		}
		///-------------------------------------------------------------------------------------------------------------------------
		/// <summary>Save 버튼 클릭</summary>
		///-------------------------------------------------------------------------------------------------------------------------
		private void btnSave_Click(object sender, EventArgs e)
		{
			try
			{
				//---------------------------------------------------------------------------------------------------
				//저장시 필수 값 여부 확인
				//---------------------------------------------------------------------------------------------------
				if (string.IsNullOrEmpty(this.txtCodeValue.Text))
					ComCls.cException.MessageErrorBoxShow(this, ComCls.cConst.PC_ERROR_NO_CODEVALUE, ComCls.cConst.PC_ERROR_NO_CODEVALUE_TITLE);
				else if (string.IsNullOrEmpty(this.txtCodeName.Text))
					ComCls.cException.MessageErrorBoxShow(this, ComCls.cConst.PC_ERROR_NO_CODENAME, ComCls.cConst.PC_ERROR_NO_CODENAME_TITLE);
				else
				{
					// 코드 추가
					if (this.treeCode.SelectedNode.Name == "*")
					{
						if (this.mf_CUDCodeData("SP_CODE_MANAGEMENT_CUD", "CREATE_CODE", 0, this.mv_nJobCode, this.txtCodeValue.Text, this.txtPattern.Text, this.txtCodeName.Text) == true)
						{
							//---------------------------------------------------------------------------------------------------
							//트리 읽기
							//---------------------------------------------------------------------------------------------------
							this.mf_ReadCodeTreeView();
							//---------------------------------------------------------------------------------------------------
							//수정여부 함수 호출 - 불가능
							//---------------------------------------------------------------------------------------------------
							this.mf_EditMode(false);
						}
					}
					// 코드 수정
					else
					{
						if (this.mf_CUDCodeData("SP_CODE_MANAGEMENT_CUD", "UPDATE_CODE", Convert.ToInt32(this.treeCode.SelectedNode.Name), this.mv_nJobCode, this.txtCodeValue.Text, this.txtPattern.Text, this.txtCodeName.Text) == true)
						{
							//---------------------------------------------------------------------------------------------------
							//트리 읽기
							//---------------------------------------------------------------------------------------------------
							this.mf_ReadCodeTreeView();
							//---------------------------------------------------------------------------------------------------
							//수정여부 함수 호출 - 불가능
							//---------------------------------------------------------------------------------------------------
							this.mf_EditMode(false);
						}
					}
				}
			}
			catch (Exception ex)
			{
				ComCls.cException.ExceptionMessageBox(ex, this);
			}
		}
		///-------------------------------------------------------------------------------------------------------------------------
		/// <summary>Delete 버튼 클릭</summary>
		///-------------------------------------------------------------------------------------------------------------------------
		private void btnDelete_Click(object sender, EventArgs e)
		{
			try
			{
				if (this.treeCode.SelectedNode != null)
				{
					if (ComCls.cException.MessageConfirmBoxShow(this, string.Format("[{0}]{1}", this.treeCode.SelectedNode.Text, ComCls.cConst.PC_MSG_APPBOM_DELETE_CONFIRM),
																ComCls.cConst.PC_MSG_APPBOM_DELETE_TITLE) == System.Windows.Forms.DialogResult.Yes)
					{
						if (this.mf_CUDCodeData("SP_CODE_MANAGEMENT_CUD", "DELETE_CODE", Convert.ToInt32(this.treeCode.SelectedNode.Name), this.mv_nJobCode, this.txtCodeValue.Text, this.txtPattern.Text, this.txtCodeName.Text) == true)
						{
							//---------------------------------------------------------------------------------------------------
							//트리 읽기
							//---------------------------------------------------------------------------------------------------
							this.mf_ReadCodeTreeView();
							//---------------------------------------------------------------------------------------------------
							//수정여부 함수 호출 - 불가능
							//---------------------------------------------------------------------------------------------------
							this.mf_EditMode(false);
						}
					}
				}
				else
				{
					ComCls.cException.MessageErrorBoxShow(this, ComCls.cConst.PC_MSG_NOSELECT_TREENODE, ComCls.cConst.PC_MSG_NOSELECT_TREENODE_TITLE);
				}
			}
			catch (Exception ex)
			{
				ComCls.cException.ExceptionMessageBox(ex, this);
			}
		}
		///-------------------------------------------------------------------------------------------------------------------------
		/// <summary>Cancel 버튼 클릭</summary>
		///-------------------------------------------------------------------------------------------------------------------------
		private void btnCancel_Click(object sender, EventArgs e)
		{
			try
			{
				if (this.treeCode.SelectedNode != null)
				{
					if (treeCode.SelectedNode.Name == "*")
					{
						if (treeCode.SelectedNode.Parent != null)
						{
							TreeNode tnParent = this.treeCode.SelectedNode.Parent;
							this.treeCode.SelectedNode.Parent.Nodes.RemoveByKey(this.treeCode.SelectedNode.Name);
							this.treeCode.SelectedNode = tnParent;
						}
						else
						{
							this.treeCode.Nodes.RemoveByKey(this.treeCode.SelectedNode.Name);
						}
					}
					else
					{
					}
				}
				//---------------------------------------------------------------------------------------------------
				//수정여부 함수 호출 - 불가능
				//---------------------------------------------------------------------------------------------------
				this.mf_EditMode(false);
				//---------------------------------------------------------------------------------------------------
			}
			catch (Exception ex)
			{
				ComCls.cException.ExceptionMessageBox(ex, this);
			}
		}
		///-------------------------------------------------------------------------------------------------------------------------
		/// <summary>Refresh 버튼 클릭</summary>
		///-------------------------------------------------------------------------------------------------------------------------
		private void btnRefresh_Click(object sender, EventArgs e)
		{
			try
			{
				//---------------------------------------------------------------------------------------------------
				//Code 목록 TreeView에 새로 출력
				//---------------------------------------------------------------------------------------------------
				this.mf_ReadCodeTreeView();
				//---------------------------------------------------------------------------------------------------
			}
			catch (Exception ex)
			{
				ComCls.cException.ExceptionMessageBox(ex, this);
			}
		}
		///-------------------------------------------------------------------------------------------------------------------------
		/// <summary>Tree 내의 마우스로 파트코드(노드) 클릭 시</summary>
		///-------------------------------------------------------------------------------------------------------------------------
		private void treeCode_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
		{
			try
			{
				((TreeView)sender).SelectedNode = ((TreeView)sender).GetNodeAt(e.X, e.Y);
			}
			catch (Exception ex)
			{
				ComCls.cException.ExceptionMessageBox(ex, this);
			}
		}
		///-------------------------------------------------------------------------------------------------------------------------
		/// <summary>Tree 내의 파트코드 선택 시</summary>
		///-------------------------------------------------------------------------------------------------------------------------
		private void treeCode_AfterSelect(object sender, TreeViewEventArgs e)
		{
			try
			{
				if (e.Node.Tag != null)
				{
					//---------------------------------------------------------------------------------------------------
					//Node의 Tag를 CodeValue / Pattern 으로 Parsing
					//---------------------------------------------------------------------------------------------------
					mv_saTreeSelectCode = e.Node.Tag.ToString().Split(mv_saTreeSepa, StringSplitOptions.None);

					this.txtCodeValue.Text = mv_saTreeSelectCode[0];			//Code Value 값 넣기
					this.txtCodeName.Text = e.Node.Text;						//Code Name 값 넣기
					this.txtPattern.Text = mv_saTreeSelectCode[1];				//Pattern 값 넣기
					//---------------------------------------------------------------------------------------------------
				}
			}
			catch (Exception ex)
			{
				ComCls.cException.ExceptionMessageBox(ex, this);
			}
		}

		///-------------------------------------------------------------------------------------------------------------------------
		/// <summary>Tree 최상위 노드 추가 ContextMenu 클릭 시 </summary>
		///-------------------------------------------------------------------------------------------------------------------------
		private void subMenuCreateTopCode_Click(object sender, EventArgs e)
		{
			TreeNode tnAddNewNode = new TreeNode { Text = "*New Code", Name = "*" };

			try
			{
				this.treeCode.Nodes.Add(tnAddNewNode);
				this.treeCode.SelectedNode = tnAddNewNode;
				//---------------------------------------------------------------------------------------------------
				//입력할 TextBox 초기화
				//---------------------------------------------------------------------------------------------------
				this.txtCodeValue.Text = null;
				this.txtCodeName.Text = null;
				this.txtPattern.Text = null;
				//---------------------------------------------------------------------------------------------------
				//수정여부 함수 호출 - 가능
				//---------------------------------------------------------------------------------------------------
				this.mf_EditMode(true);
			}
			catch (Exception ex)
			{
				ComCls.cException.ExceptionMessageBox(ex, this);
			}
		}

		///-------------------------------------------------------------------------------------------------------------------------
		/// <summary>Tree 추가 ContextMenu 클릭 시 </summary>
		///-------------------------------------------------------------------------------------------------------------------------
		private void subMenuAddCode_Click(object sender, EventArgs e)
		{
			TreeNode tnAddNewNode = new TreeNode { Text = "*New Code", Name = "*" };

			try
			{
				if (this.treeCode.SelectedNode != null)
				{
					if (ComCls.cException.MessageConfirmBoxShow(this, string.Format("[{0}]{1}", this.treeCode.SelectedNode.Text, ComCls.cConst.PC_MSG_APPBOM_UPDATE_TREE_CONFIRM),
																ComCls.cConst.PC_MSG_APPBOM_UPDATE_TITLE) == System.Windows.Forms.DialogResult.Yes)
					{
						//---------------------------------------------------------------------------------------------------
						//입력할 TextBox 초기화
						//---------------------------------------------------------------------------------------------------
						this.txtCodeValue.Text = null;
						this.txtCodeName.Text = null;
						this.txtPattern.Text = null;
						//---------------------------------------------------------------------------------------------------
						//추가될 노드 임시 생성
						//---------------------------------------------------------------------------------------------------
						this.treeCode.SelectedNode.Nodes.Add(tnAddNewNode);
						this.treeCode.SelectedNode = tnAddNewNode;
						//---------------------------------------------------------------------------------------------------
						//수정여부 함수 호출 - 가능
						//---------------------------------------------------------------------------------------------------
						this.mf_EditMode(true);
					}
				}
				else
				{
					ComCls.cException.MessageErrorBoxShow(this, ComCls.cConst.PC_MSG_NOSELECT_TREENODE, ComCls.cConst.PC_MSG_NOSELECT_TREENODE_TITLE);
				}
			}
			catch (Exception ex)
			{
				ComCls.cException.ExceptionMessageBox(ex, this);
			}
		}
		///-------------------------------------------------------------------------------------------------------------------------
		/// <summary>Tree 삭제 ContextMenu 클릭 시 </summary>
		///-------------------------------------------------------------------------------------------------------------------------
		private void subMenuDeleteCode_Click(object sender, EventArgs e)
		{
			try
			{
				if (this.treeCode.SelectedNode != null)
				{
					if (ComCls.cException.MessageConfirmBoxShow(this, string.Format("[{0}]{1}", this.treeCode.SelectedNode.Text, ComCls.cConst.PC_MSG_APPBOM_DELETE_CONFIRM),
																ComCls.cConst.PC_MSG_APPBOM_DELETE_TITLE) == System.Windows.Forms.DialogResult.Yes)
					{
						if (this.mf_CUDCodeData("SP_CODE_MANAGEMENT_CUD", "DELETE_CODE", Convert.ToInt32(this.treeCode.SelectedNode.Name), this.mv_nJobCode, this.txtCodeValue.Text, this.txtPattern.Text, this.txtCodeName.Text) == true)
						{
							//---------------------------------------------------------------------------------------------------
							//트리 읽기
							//---------------------------------------------------------------------------------------------------
							this.mf_ReadCodeTreeView();
							//---------------------------------------------------------------------------------------------------
							//수정여부 함수 호출 - 불가능
							//---------------------------------------------------------------------------------------------------
							this.mf_EditMode(false);
						}
					}
				}
				else
				{
					ComCls.cException.MessageErrorBoxShow(this, ComCls.cConst.PC_MSG_NOSELECT_TREENODE, ComCls.cConst.PC_MSG_NOSELECT_TREENODE_TITLE);
				}
			}
			catch (Exception ex)
			{
				ComCls.cException.ExceptionMessageBox(ex, this);
			}
		}
		///-------------------------------------------------------------------------------------------------------------------------
		/// <summary>Tree Refresh ContextMenu 클릭 시 </summary>
		///-------------------------------------------------------------------------------------------------------------------------
		private void subMenuRefreshCode_Click(object sender, EventArgs e)
		{
			try
			{
				//---------------------------------------------------------------------------------------------------
				//Code 목록 TreeView에 새로 출력
				//---------------------------------------------------------------------------------------------------
				this.mf_ReadCodeTreeView();
				//---------------------------------------------------------------------------------------------------
			}
			catch (Exception ex)
			{
				ComCls.cException.ExceptionMessageBox(ex, this);
			}
		}
		///-------------------------------------------------------------------------------------------------------------------------
		/// <summary>Code Value 값 텍스트 변경 시 </summary>
		///-------------------------------------------------------------------------------------------------------------------------
		private void txtCodeValue_TextChanged(object sender, EventArgs e)
		{
			try
			{
				//Tree 부모 노드가 없을 경우 (최상위 노드 추가시)
				if (this.treeCode.SelectedNode.Parent == null)
				{
					//CodeValue에 입력되는 값이 Patter 텍스트박스에 그대로 전달
					this.txtPattern.Text = ((TextBox)sender).Text;
				}
				//Tree 부모 노드가 있을 경우 (자식 노드 추가시)
				else
				{
					if (this.treeCode.SelectedNode.Parent.Tag != null)
					{
						//부모 노드의 Pattern 값 + 작성되는 CodeValue 값으로 Patter 텍스트박스에 전달
						mv_saTreeProperty = this.treeCode.SelectedNode.Parent.Tag.ToString().Split(mv_saTreeSepa, StringSplitOptions.None);
						this.txtPattern.Text = mv_saTreeProperty[1] + ((TextBox)sender).Text;
					}
				}
			}
			catch (Exception ex)
			{
				ComCls.cException.ExceptionMessageBox(ex, this);
			}
		}
		///-------------------------------------------------------------------------------------------------------------------------
		/// <summary>Code Name 값 텍스트 변경 시 </summary>
		///-------------------------------------------------------------------------------------------------------------------------
		private void txtCodeName_TextChanged(object sender, EventArgs e)
		{
			try
			{
				//---------------------------------------------------------------------------------------------------
				//CodeName에 입력되는 값이 Tree 해당노드에 전달
				//---------------------------------------------------------------------------------------------------
				if (btnEdit.Enabled == false)
				{
					this.treeCode.SelectedNode.Text = ((TextBox)sender).Text;
				}
				//---------------------------------------------------------------------------------------------------
			}
			catch (Exception ex)
			{
				ComCls.cException.ExceptionMessageBox(ex, this);
			}
		}

		private void treeCode_ItemDrag(object sender, ItemDragEventArgs e)
		{
			//this.treeCode.DoDragDrop(e.Item, DragDropEffects.Move);
		}
		#endregion

		//▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
	}// End class frmCodeManagement
}// End namespace TimsXBX
